home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2000 #4 / Amiga Plus CD - 2000 - No. 4.iso / Tools / Dev / Bgui / AutoDoc / methods.doc < prev    next >
Encoding:
Text File  |  2000-05-09  |  5.4 KB  |  195 lines

  1. TABLE OF CONTENTS
  2.  
  3. methods/--background--
  4. methods/GRM_DIMENSIONS
  5. methods/WM_KEYACTIVE
  6. methods/WM_KEYINACTIVE
  7. methods/WM_KEYINPUT
  8.  
  9. methods/--background--
  10.  
  11.     DESCRIPTION
  12.     Gadget    classes  that  want to work in a BGUI environment will need to
  13.     know about a set of extra methods on top of the  normal system    gadget
  14.     class methods. This document describes these methods.
  15.  
  16.     Not    all    system    gadgetclass    methods      will      reach   your
  17.     class.    The following    standard   system   gadgetclass   methods  are
  18.     passed onto your class:
  19.  
  20.         GM_HITTEST
  21.         GM_RENDER
  22.         GM_GOACTIVE
  23.         GM_HANDLEINPUT
  24.         GM_GOINACTIVE
  25.  
  26.     The  following    methods  are  not used in a BGUI context and therefore
  27.     will not be send to your class:
  28.  
  29.         GM_HELPTEST
  30.         GM_LAYOUT
  31.  
  32. methods/GRM_DIMENSIONS
  33.  
  34.     CLASS
  35.     groupclass
  36.  
  37.     NAME
  38.     GRM_DIMENSIONS
  39.  
  40.     FUNCTION
  41.     To inquire about a gadget object it's minimum  width and  height.  The
  42.     group class sends out this method  to all  it's  members to  ensure  a
  43.     correct  layout.   This  method  uses  the  following  custom  message
  44.     structure:
  45.  
  46.     struct grmDimensions {
  47.         ULONG            MethodID;    /* GRM_DIMENSIONS */
  48.         struct GadgetInfo      *grmd_GInfo;
  49.         struct RastPort        *grmd_RPort;
  50.         struct {
  51.             UWORD           *Width;
  52.             UWORD           *Height;
  53.         }            grmd_MinSize;
  54.         ULONG            grmd_Flags;
  55.     };
  56.  
  57.     grmd_GInfo -- This  field  will  always  read  NULL!  It will probably
  58.         become obsolete in one of the next versions.   Please  do  not
  59.         make any assumptions about it's contents.   Simply  ignore  it
  60.         until further notice.
  61.  
  62.     grmd_RPort -- This points to a RastPort which can be  used  to perform
  63.         text width/height computations etc. in.   Do  *not*  render in
  64.         this RastPort.
  65.  
  66.     grmd_MinSize --  This  field  contains    two pointers in which you must
  67.         store the results of your computations.   Note    that you  must
  68.         *add* your results to the results you got from the superclass.
  69.  
  70.         Example:
  71.  
  72.         switch ( msg->MethodID ) {
  73.             case    GRM_DIMENSIONS:
  74.             /*
  75.             **    First the superclass...
  76.             **/
  77.             DoSuperMethodA( class, object, msg );
  78.             /*
  79.             **    Compute your minimum sizes.
  80.             **/
  81.             ...
  82.             /*
  83.             **    Add results.
  84.             **/
  85.             *( msg->grmd_MinSize.Width  ) += your_min_width;
  86.             *( msg->grmd_MinSize.Height ) += your_min_height;
  87.             break;
  88.         }
  89.  
  90.         There  might  be  cases  in  which  you  want  to  overide the
  91.         superclass  results  which  is    perfectly  legal to do but you
  92.         should be aware that wrong values here might  seriously  screw
  93.         up the look of the resulting GUI.
  94.  
  95.     grmd_Flags -- This field may contain any of the following flags:
  96.  
  97.         GDIMF_NO_FRAME -- This will tell the baseclass not to take the
  98.             attached frame into consideration  when  computing the
  99.             minimum size.
  100.  
  101. methods/WM_KEYACTIVE
  102.  
  103.     CLASS
  104.     windowclass
  105.  
  106.     NAME
  107.     WM_KEYACTIVE
  108.  
  109.     FUNCTION
  110.     To  tell  the  object  that  it  is  activated    by  a key-press. Uppon
  111.     receiving  this message you can setup any additional resources you may
  112.     need  to  go  active.  This  method  uses the following custom message
  113.     structure:
  114.  
  115.     struct wmKeyInput {
  116.         ULONG             MethodID; /* WM_KEY_ACTIVE */
  117.         struct GadgetInfo    *wmki_GInfo;
  118.         struct InputEvent    *wmki_IEvent;
  119.         ULONG            *wmki_ID;
  120.         STRPTR             wmki_Key;
  121.     };
  122.  
  123.     wmki_GInfo -- This points to a GadgetInfo structure.
  124.  
  125.     wmki_IEvent -- A pointer to a InputEvent structure  which is the event
  126.         that  triggered  the  activation.   The  event class is always
  127.         IECLASS_RAWKEY. This event can be used to check for  qualifier
  128.         keys etc.
  129.  
  130.     wmki_ID -- In  this field you can store the ID of the  object when the
  131.         activation has resulted in a change that needs to be notified.
  132.         The value put  in  here is  returned  by the  windowclass it's
  133.         WM_HANDLEIDCMP method.
  134.  
  135.     wmki_Key -- This points to the key string which  has been  assigned to
  136.         the object with the windowclass it's WM_GADGETKEY method.
  137.  
  138.     RESULT
  139.     This method should return any of the following return codes:
  140.  
  141.     WMKF_MEACTIVE -- The object can go/remains active.
  142.     WMKF_CANCEL -- The keyboard activation is cancelled.
  143.     WMKF_VERIFY -- The keyboard activation is complete and the  ID    set in
  144.         the wmki_ID field is notified.
  145.     WMKF_ACTIVATE -- Returning this tell's the windowclass to activate the
  146.         gadget using the intuition.library it's ActivateGadget() call.
  147.  
  148.     SEE ALSO
  149.     windowclass/WM_KEYINPUT, windowclass/WM_KEYINACTIVE,
  150.     windowclass/WM_KEYINACTIVE windowclass/WM_HANDLEIDCMP,
  151.     windowclass/WM_GADGETKEY, intuition.library/ActivateGadget()
  152.  
  153. methods/WM_KEYINACTIVE
  154.  
  155.     CLASS
  156.     windowclass
  157.  
  158.     NAME
  159.     WM_KEYINACTIVE
  160.  
  161.     FUNCTION
  162.     When the key-activation of an object is done or aborted by some  other
  163.     event this method is called to tell to object  to go  inactive.   This
  164.     gives you the oppertunity to release the resources that you might have
  165.     obtained with the WM_KEYACTIVE method.
  166.  
  167.     RESULT
  168.     No return code defined.
  169.  
  170.     SEE ALSO
  171.     windowclass/WM_KEYACTIVE
  172.  
  173. methods/WM_KEYINPUT
  174.  
  175.     CLASS
  176.     windowclass
  177.  
  178.     NAME
  179.     WM_KEYINPUT
  180.  
  181.     FUNCTION
  182.     This method is send to the object  continually    when the  WM_KEYACTIVE
  183.     returned WMKF_MEACTIVE    and the  object has  gone active.  This method
  184.     uses the same custom message structure as the WM_KEYACTIVE method does
  185.     and it should return any of the same return codes as described    in the
  186.     WM_KEYACTIVE method with the exception of WMKF_ACTIVATE.
  187.  
  188.     A good example of this method  is  the    buttonclass  which  uses  this
  189.     method    to  scan  for  the SHIFT  qualifier and/or the ESC  key  which
  190.     both cancel a keyboard button selection.
  191.  
  192.     SEE ALSO
  193.     windowclass/WM_KEYACTIVE
  194.  
  195.